<template>
  <div class="dashboard-container">
    <div class="dashboard-text">表情包: {{ dashboard.sutanpu.count }}</div>
    <div class="dashboard-text">同人图: {{ dashboard.photo.count }}</div>
    <div class="dashboard-text">音乐: {{ dashboard.music.count }}</div>
    <div class="dashboard-text">视频: {{ dashboard.vedio.count }}</div>
  </div>
</template>

<script>
'use strict'

import { mapGetters } from 'vuex'
import { getInitData } from '@/api/dashboard'

export default {
  name: 'Dashboard',
  data() {
    return {
      dashboard: {
        sutanpu: {
          count: 0
        },
        photo: {
          count: 0
        },
        music: {
          count: 0
        },
        vedio: {
          count: 0
        }
      }

    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  created() {
    this.fetchData()
  },
  methods: {
    fetchData() {
      this.listLoading = true
      getInitData().then(response => {
        this.dashboard = response.data

        // this.sutanpu.count = response.data.sutanpu.count
        // this.photo.count = response.data.photo.count
        // this.music.count = response.data.music.count
        // this.vedio.count = response.data.vedio.count
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
